import axios from 'network/axios'

export function clear(id) {
  return axios({
    url: '/api/experiment/clear',
    method: 'post',
    data: {
      id: id
    }
  })
}

export function getOneStatus(id) {
  return axios({
    url: '/api/experiment/getOneStatus',
    method: 'get',
    params: {
      id: id,
    }
  })
}

export function changeOneStatus(id, status) {
  return axios({
    url: '/api/experiment/changeStatus',
    method: 'post',
    data: {
      id: id,
      status: status
    }
  })
}


export function getCode(id) {
  return axios({
    url: '/api/experiment/getCode',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function saveCode(id, code) {
  return axios({
    url: '/api/experiment/saveCode',
    method: 'post',
    data: {
      id: id,
      code: code
    }
  })
}

export function getPos(id) {
  return axios({
    url: '/api/experiment/getPos',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function savePos(planeArr) {
  return axios({
    url: '/api/experiment/savePos',
    method: 'post',
    data: {
      planeArr: planeArr
    }
  })
}

export function getOrder() {
  return axios({
    url: '/api/experiment/getOrder',
    method: 'get'
  })
}

export function getPlaneOrder() {
  return axios({
    url: '/api/experiment/getPlaneOrder',
    method: 'get'
  })
}

export function saveOrder(data) {
  return axios({
    url: '/api/experiment/saveOrder',
    method: 'post',
    data: data
  })
}

export function savePlaneOrder(plane_id, order_id) {
  return axios({
    url: '/api/experiment/savePlaneOrder',
    method: 'post',
    data: {
      plane_id: plane_id,
      order_id: order_id
    }
  })
}
